import React, {PropsWithChildren, useState} from 'react'
import LazyTabs from "../../components/LazyTabs";
import OrderPageablePanel from "../../components/OrderPageablePanel";
import "./Index.module.sass"

export interface IndexProps extends PropsWithChildren {

}

const Index: React.FC<IndexProps> = ({}) => {
    const [selectedTabKey, setSelectedTabKey] = useState(0)
    let onChange = v => {
        setSelectedTabKey(v as number)
    };
    return <>
        <LazyTabs value={selectedTabKey} onChange={onChange}
                  tabStyle={{position: "sticky", top: 0, zIndex: 11}}
                  lazyItems={[
                      {
                          key: 0,
                          label: "电器",
                          render: () => {
                              return <OrderPageablePanel isAppliance={true}></OrderPageablePanel>;
                          }
                      },
                      {
                          key: 1,
                          label: "数码",
                          render: () => {
                              return <OrderPageablePanel isAppliance={false}></OrderPageablePanel>;
                          }
                      },
                  ]}/>

    </>
}

export default Index


